Skip to content

Replace unmaintained chrono with jiff (RUSTSEC-2026-0543) - #2344

Open
jrparks wants to merge 5 commits into
tursodatabase:mainfrom
jrparks:up/chrono-to-jiff
Open

jrparks wants to merge 5 commits into
tursodatabase:mainfrom
jrparks:up/chrono-to-jiff

Conversation

@jrparks

@jrparks jrparks commented Dec 1, 2026

Copy link
Copy Markdown

Follows up issue #2341. There has been no reply yet, so this is sent as a proposal; close it if you would rather not take it.

chrono is marked unmaintained (RUSTSEC-2026-0543, every version affected). This moves libsql-server, bottomless and bottomless-cli to jiff. It is a mechanical type swap (NaiveDateTime to jiff::civil::DateTime, DateTime<Utc> to jiff::Timestamp) plus four behaviours kept on purpose, because a naive swap would change them:

  • Tombstone for "delete everything" is still 8210266876799 (the timestamp of chrono's NaiveDateTime::MAX). Tombstones already stored in S3 hold that value and it is past what jiff can represent, so it is clamped when read instead of being treated as absent.
  • JWT exp is a plain i64 again. Tokens that never expire carry values past year 9999, which a date type rejects but jsonwebtoken accepts (two existing tests in auth::parsers use such a token).
  • Fork timestamp (admin API) and the bottomless-cli date arguments are parsed strictly as YYYY-MM-DDTHH:MM:SS[.f] / YYYY-MM-DD. jiff's own civil parser silently drops a +05:00 offset, which would restore to the wrong moment.
  • bottomless-cli prints the same created at text as before.

Tests added: parser unit tests, the tombstone constant and clamping, the admin fork request, and next_hour. cargo test -p bottomless -p libsql-server --lib passes (bottomless 8, libsql-server 102, 2 ignored). Not run against a real S3.

Cargo.lock also moves portable-atomic, proc-macro2 and quote (jiff's macro crate needs syn 3). chrono stays in the lockfile through other crates' optional features.

The branch sits on top of the two CI commits from #2317 so the Extensions and Go checks can run; they drop out once #2317 merges. It touches bottomless-cli/src/replicator_extras.rs, so it will need a small rebase if #2342 merges first.

ubuntu-latest moved to Ubuntu 26.04 between 2026-11-08 and 2026-11-11.
On 26.04 these jobs fail before reaching any test: CMake 4 rejects
wabt-sys 0.6.1 (cmake_minimum_required < 3.5) and the sqlite3_capi
bindings come out empty. The same jobs pass on 24.04, which every
green run so far used. Pinning restores CI for open PRs until the
toolchain issues are fixed properly.

Refs tursodatabase#2315
Go 1.27.4 refuses to link libsql_experimental.a: "disallowed LTO section
".llvmbc" in #cgo LDFLAGS". setup-go '>=1.21' picked 1.27.4 on the
first run of this PR; the last green run used 1.27.3. Pin until the
static library is built without embedded bitcode.

Refs tursodatabase#2315
chrono is unmaintained and every version is affected. libsql-server,
bottomless and bottomless-cli now use jiff.

Behaviour kept on purpose:
- The tombstone for "delete everything" is still 8210266876799 (the
  timestamp of chrono's NaiveDateTime::MAX). Tombstones already in S3 hold
  it, and it is past what jiff can represent, so it is clamped when read
  instead of being treated as absent.
- The JWT `exp` claim is a plain i64 again. Tokens that never expire
  carry values past year 9999 that a date type rejects.
- The fork timestamp (admin API) and the bottomless-cli date arguments are
  parsed strictly as YYYY-MM-DDTHH:MM:SS[.f] / YYYY-MM-DD. jiff's own
  parser would silently drop a "+05:00" offset and restore to the wrong
  moment.
- bottomless-cli prints the same `created at` text as before.

Tests: unit tests for the parsers, the tombstone constant and clamping,
the admin fork request and next_hour.

This branch has not been deployed

No deployments
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant